//
//	ZcoModelLinkInfo.m
//	Model file generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport



#import "ZcoModelLinkInfo.h"

NSString *const kZcoModelLinkInfoName = @"name";
NSString *const kZcoModelLinkInfoSize = @"size";
NSString *const kZcoModelLinkInfoSuffix = @"suffix";
NSString *const kZcoModelLinkInfoType = @"type";
NSString *const kZcoModelLinkInfoUrl = @"url";

@interface ZcoModelLinkInfo ()
@end
@implementation ZcoModelLinkInfo




/**
 * Instantiate the instance using the passed dictionary values to set the properties values
 */

-(instancetype)initWithDictionary:(NSDictionary *)dictionary
{
	self = [super init];
	if(![dictionary[kZcoModelLinkInfoName] isKindOfClass:[NSNull class]]){
		self.name = dictionary[kZcoModelLinkInfoName];
	}	
	if(![dictionary[kZcoModelLinkInfoSize] isKindOfClass:[NSNull class]]){
		self.size = [dictionary[kZcoModelLinkInfoSize] integerValue];
	}

	if(![dictionary[kZcoModelLinkInfoSuffix] isKindOfClass:[NSNull class]]){
		self.suffix = dictionary[kZcoModelLinkInfoSuffix];
	}	
	if(![dictionary[kZcoModelLinkInfoType] isKindOfClass:[NSNull class]]){
		self.type = dictionary[kZcoModelLinkInfoType];
	}	
	if(![dictionary[kZcoModelLinkInfoUrl] isKindOfClass:[NSNull class]]){
		self.url = dictionary[kZcoModelLinkInfoUrl];
	}	
	return self;
}


/**
 * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
 */
-(NSDictionary *)toDictionary
{
	NSMutableDictionary * dictionary = [NSMutableDictionary dictionary];
	if(self.name != nil){
		dictionary[kZcoModelLinkInfoName] = self.name;
	}
	dictionary[kZcoModelLinkInfoSize] = @(self.size);
	if(self.suffix != nil){
		dictionary[kZcoModelLinkInfoSuffix] = self.suffix;
	}
	if(self.type != nil){
		dictionary[kZcoModelLinkInfoType] = self.type;
	}
	if(self.url != nil){
		dictionary[kZcoModelLinkInfoUrl] = self.url;
	}
	return dictionary;

}

/**
 * Implementation of NSCoding encoding method
 */
/**
 * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
 */
- (void)encodeWithCoder:(NSCoder *)aCoder
{
	if(self.name != nil){
		[aCoder encodeObject:self.name forKey:kZcoModelLinkInfoName];
	}
	[aCoder encodeObject:@(self.size) forKey:kZcoModelLinkInfoSize];	if(self.suffix != nil){
		[aCoder encodeObject:self.suffix forKey:kZcoModelLinkInfoSuffix];
	}
	if(self.type != nil){
		[aCoder encodeObject:self.type forKey:kZcoModelLinkInfoType];
	}
	if(self.url != nil){
		[aCoder encodeObject:self.url forKey:kZcoModelLinkInfoUrl];
	}

}

/**
 * Implementation of NSCoding initWithCoder: method
 */
- (instancetype)initWithCoder:(NSCoder *)aDecoder
{
	self = [super init];
	self.name = [aDecoder decodeObjectForKey:kZcoModelLinkInfoName];
	self.size = [[aDecoder decodeObjectForKey:kZcoModelLinkInfoSize] integerValue];
	self.suffix = [aDecoder decodeObjectForKey:kZcoModelLinkInfoSuffix];
	self.type = [aDecoder decodeObjectForKey:kZcoModelLinkInfoType];
	self.url = [aDecoder decodeObjectForKey:kZcoModelLinkInfoUrl];
	return self;

}

/**
 * Implementation of NSCopying copyWithZone: method
 */
- (instancetype)copyWithZone:(NSZone *)zone
{
	ZcoModelLinkInfo *copy = [ZcoModelLinkInfo new];

	copy.name = [self.name copy];
	copy.size = self.size;
	copy.suffix = [self.suffix copy];
	copy.type = [self.type copy];
	copy.url = [self.url copy];

	return copy;
}
@end